<script setup lang="ts">
import TestAdd from './testAdd.vue';
import { onMounted, useTemplateRef } from 'vue';

type FooType = InstanceType<typeof TestAdd>;
// const testAddRef = ref<TestAdd | null>(null)
const testAddRef = useTemplateRef<FooType>('testAddRef');

onMounted(() => {
  console.log(testAddRef.value, '====');
  // testAddRef.value.openDialog()
});
</script>

<template>
  <div>
    引入testAdd，测试 templateRef的类型
    <TestAdd ref="testAddRef"></TestAdd>
  </div>
</template>

<style scoped lang="less"></style>
